<?php

namespace System\Core\Errors;

use Exception;

/**
 * Description of Exceptions
 *
 * @author elton.schivei
 */
class Exceptions extends Exception
{

    public function __construct($message, $code = null, $previous = null)
    {
        $except = null;

        if ($message instanceof Exception)
        {
            $except = clone $message;

            $message = $except->getMessage();
            $code = $except->getCode();
            $previous = $except->getPrevious();
        }

        parent::__construct($message, $code, $previous);

        if ($except instanceof Exception)
        {
            $this->file = $except->file;
        }
    }

    public function GetSeverity()
    {
        return \E_USER_ERROR | \E_ERROR;
    }

}
